/**
 *
 */
package jdk8;

import java.util.function.Consumer;

/**
 * @Title:
 * @author zhoujie
 * @date 2018年7月18日 下午5:04:45
 *
 */
public class MyConsumer<T> implements Consumer<T> {
    private T data = null;

    @Override
    public void accept(T t) {
        this.data = t;
    }

    public T getData() {
        return data;
    }

    public static <T> void println(Consumer<T> consumer, T t) {
        consumer.accept(t);
    }


    public static void main(String[] args) {
        Consumer<String> consumer = (s) -> System.out.println(s);
        consumer.accept("sky");


        MyConsumer.println(s -> System.out.println(s), "sky");
    }
}
